<?php

class PlatformDev extends  PlatformBase
{
    /**
     * @var PlatformDev
     */
    private static $instance;

    /**
     * Get the instance of PlatformDev.
     *
     * @return PlatformDev
     */
    public static function get()
    {
        if (!self::$instance) {
            self::$instance = new PlatformDev();
        }
        return self::$instance;
    }

    private function __construct()
    {
        $this->configs = SzConfig::get()->loadAppConfig('app');
    }

    /**
     * 验证token
     *
     * @param string $platformId  平台ID
     * @param string $token 登录token
     * @return bool
     */
    public function checkToken($platformId, $token)
    {
        if ($token == GameConst::MAGIC_TOKEN) {
            return true;
        }
        if ($this->configs['ENV'] == 'DEV') {
            // 测试环境，跳过验证
            return true;
        }
        return false;
    }

}